package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Ap0stoL2
 * Date: 2023-07-24
 * Time: 8:45
 */
//后台线程的结束
public class Demo7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t= new Thread(()->{
           while(true){
               System.out.println("i am thread");
           }
        });

        t.setDaemon(true);

        System.out.println("i am main,i start to sleep here");
        System.out.println("after 5 s,i will end");
        Thread.sleep(5000);

    }
}
